<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

require dirname(__FILE__).'/pc_controller.php';

require_once dirname(__FILE__).'/menu.php';

class Hd_oil_subsidy_history extends PC_controller {

    public function __construct(){
        parent::__construct();
        $this->load->model('Hdoilsubsidycustomermodel','m_customer');
    }

    public function index(){
        $data = parent::index();

        $this->load->view('admin/hd_oil_subsidy_history',$data);
    }

    public function getLotteryHistoryList() {
        $assist['where'] = getFilter($this->input->post(),Hdoilsubsidycustomermodel::$historySearchField);
        $assist['like'] = getFilter($this->input->post(),Hdoilsubsidycustomermodel::$historyLikeField);
        $assist['pagination'] = getPagination($this->input->post());

         if(isset($assist['where']['hd_oil_subsidy_history.gift_money'])) {
            $gift_money = $assist['where']['hd_oil_subsidy_history.gift_money'];
            unset($assist['where']['hd_oil_subsidy_history.gift_money']);
            $assist['where'][$gift_money > 0 ? 'hd_oil_subsidy_history.gift_money >' : 'hd_oil_subsidy_history.gift_money'] ='0';
        }


        $assist['select'] = '
            hd_oil_subsidy_customer.customer_id,
            hd_oil_subsidy_customer.nickname,
            hd_oil_subsidy_history.*,
            hd_oil_subsidy_city.*
        ';
        list($list,$count) = $this->m_customer->getHistoryListSection($assist);

        foreach ($list as $key => $value) {
            $list[$key]['nickname'] = urldecode($value['nickname']);
        }

        $this->response->setSuccess();
        $this->response->setItems($list);
        $this->response->setTotalCount($count);
        $this->response->responseExit();
    }

}
/* End of file aa_game_history.php */
/* Location: ./application/controllers/aa_game_history.php */